import { ExtOrder } from "~/extend";
import { PutDto, PutRes } from "~/rest";
import { ExtUUidTuple } from "~/db.pg";

import { getGateway, Gateway } from "@/droplet-bus/core.define";
import { ExtOwner } from "@/stream-user/core.define";

import { app_gateway } from "./core.gateway";
import type { PaymentWeChatMp } from "./schema.wxmp";

export const PaymentWeChatMpGateway: Gateway = getGateway(app_gateway, "stream_pay_wxmp");
export type patchPaymentWxmpDto = PutDto<ExtUUidTuple & ExtOwner & ExtOrder>;

export interface PaymentWxmpInterfaceWithDerive<T> {
  /** 同步远程支付情况，到本地订单 */
  patch(dto: T & patchPaymentWxmpDto): Promise<PutRes<PaymentWeChatMp>>;
}
